<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.org/rich"
	template="../include/template.xhtml">
	
	<ui:define name="pageTitle">
		<h:outputText value="管理面板" />
	</ui:define>
	
	<ui:define name="content">
		<style type="text/css">
<!--
.inputClass {
	border: 1px solid #6699CC;
	width: 300px;
	margin-left: 4px;
}

.divHeight {
	height: 420px;
}

.footClass {
	background-color: #fff;
}

.rich-stglpanel-header {
	background-color: #fff;
}

.bidTable {
	width: 100%;
	margin: 1px auto;
	border: 1px #c0d5e6 solid;
	background-color: #f6fbff;
}

.gbutton {
	font-weight: normal;
	color: #3599fc;
	background-color: #ebf3fb;
	border: 1px solid #83c1fd;
	height: 23px;
	background-image: url(../images/btnbg.gif);
	padding: 2px 5px;
}
-->
</style>
		
			<s:div style="float:left;width:700px;">

				<h:panelGrid columns="3"
					style="width:30%;margin:8px auto 10px 10px;">
					<h:outputText value="欢迎您，[#{loginUser.nickName}]"></h:outputText>
					
				</h:panelGrid>
				
				<rich:simpleTogglePanel switchType="client" headerClass="headerClass">
					<f:facet name="header">
						<s:div styleClass="">
							<h:outputText value=". 我的消息" />
						</s:div>
					</f:facet>
					<h:panelGrid columns="3" style="width:100%;">
						<s:link value="新消息[#{messageIndexAction.newMessages.size()}]"
							view="/message/index.xhtml">
							<f:param name="msgType" value="NEW" />
						</s:link>
						<s:link value="已读消息[#{messageIndexAction.readedMessages.size()}]"
							view="/message/index.xhtml">
							<f:param name="msgType" value="READED" />
						</s:link>
						<h:outputText value="关注我的人[20]"></h:outputText>
					</h:panelGrid>
				</rich:simpleTogglePanel>
				<rich:spacer height="1px" />
				<rich:simpleTogglePanel switchType="client" headerClass="headerClass">
					<f:facet name="header">
						<s:div styleClass="">
							<h:outputText value=". 我发布的项目" />
						</s:div>
					</f:facet>
					<h:form id="dt">
						<rich:dataGrid value="#{taskIndexAction.ownTasks}" columns="1"
							var="vtask" style="border-style:none;width:100%;padding:0px;"
							elements="5" columnClasses="spaceClass" footerClass="footClass">

							<rich:togglePanel switchType="client"
								stateOrder="first,second,third,fourth">

								<f:facet name="first">
									<ui:include src="/include/passport/tipBlock.xhtml">
										<ui:param name="next" value="second" />
									</ui:include>
								</f:facet>
								<f:facet name="second">
									<s:div>
										<ui:include src="/include/passport/tipBlock.xhtml"></ui:include>
										<h:panelGrid columns="1" width="100%">
											<h:outputText value="ID:#{vtask.id}" />
											<h:outputText value="名称:#{vtask.name}" />
											<h:outputText value="标签:#{vtask.tag}" />
											<h:outputText value="金额:￥ #{vtask.budget} RMB" />
											<h:outputText value="时间:#{vtask.publishDate}" />
											<h:outputText value="说明:#{vtask.description}" />
										</h:panelGrid>
									</s:div>
								</f:facet>

								<f:facet name="third">
									<s:div>
										<ui:include src="/include/passport/tipBlock.xhtml"></ui:include>
										<h:panelGrid columns="2">
											<h:outputText value="ID:" />
											<h:outputText value="#{vtask.id}" />
											<h:outputText value="名称:" />
											<h:inputText value="#{vtask.name}" class="inputClass" />
											<h:outputText value="标签:" />
											<h:inputText value="#{vtask.tag}" class="inputClass" />
											<h:outputText value="金额:(RMB)" />
											<h:inputText value="#{vtask.budget}" class="inputClass" />
											<h:outputText value="说明:" />
											<h:inputTextarea value="#{vtask.description}" rows="7"
												class="inputClass" />
										</h:panelGrid>
										<a:commandButton title="修改" value="提交" styleClass="gbutton"
											action="#{taskAddAction.modify(vtask)}" />
									</s:div>
								</f:facet>

								<f:facet name="fourth">
									<s:div>
										<ui:include src="/include/passport/tipBlock.xhtml"></ui:include>
										<br />
										<h:outputText value="投标人情况:" />
										<rich:messages id="msgs" styleClass="redAlert" />
										<a:repeat id="bids" value="#{vtask.allBid}" var="bid"
											rows="20">
											<h:panelGrid columns="2" class="bidTable">
												<a:commandButton value="中标"
													action="#{taskIndexAction.selectBidder(bid)}"
													reRender="msgs" />

												<h:panelGrid columns="2">
													<h:outputText value="昵称:" />
													<h:outputText value="#{bid.owner.nickName}" />
													<h:outputText value="Email:" />
													<h:outputText value="#{bid.owner.email}" />
													<h:outputText value="投标描述:" />
													<h:outputText value="#{bid.description}" />
												</h:panelGrid>
											</h:panelGrid>
										</a:repeat>

									</s:div>
								</f:facet>

							</rich:togglePanel>
							<f:facet name="footer">
								<h:panelGrid columns="2" style="width:100%">
									<rich:datascroller rendered="#{taskIndexAction.ownTasks.size()>5}"
										maxPages="20" />
									<s:link view="/task/add.xhtml" value="+发布项目"></s:link>
								</h:panelGrid>
							</f:facet>
						</rich:dataGrid>
					</h:form>

				</rich:simpleTogglePanel>
				<rich:spacer height="1px" />
				<rich:simpleTogglePanel switchType="client" headerClass="headerClass">
					<f:facet name="header">
						<s:div styleClass="">
							<h:outputText value=". 我中标的项目" />
						</s:div>
					</f:facet>
					
					<br />
					<a:repeat id="bids" value="#{taskIndexAction.getAcceptedBids()}"
						var="bid" rows="20">
						<h:panelGrid columns="2" class="bidTable">
							<h:outputText value="项目名称:#{bid.belongToTask.name}" />
							<a:commandButton value="中标"
								action="#{taskIndexAction.selectBidder(bid)}" reRender="msgs" />

							<h:panelGrid columns="2">
								<h:outputText value="昵称:" />
								<h:outputText value="#{bid.owner.nickName}" />
								<h:outputText value="Email:" />
								<h:outputText value="#{bid.owner.email}" />
								<h:outputText value="投标描述:" />
								<h:outputText value="#{bid.description}" />
							</h:panelGrid>
						</h:panelGrid>
					</a:repeat>

				</rich:simpleTogglePanel>
			</s:div>
			<s:div style="float:right;">
				<rich:tabPanel switchType="client" style="width:270px;" headerAlignment="left">
					<rich:tab label="First">
            Here is tab #1
					</rich:tab>
					<rich:tab label="Second" disabled="false">
            Here is tab #2
        </rich:tab>
					<rich:tab label="Third">
            Here is tab #3
        </rich:tab>
				</rich:tabPanel>
			</s:div>
	</ui:define>
</ui:composition>
